package com.houxm.caipiao.service;

import com.houxm.caipiao.util.NextTermUtil;
import com.houxm.caipiao.util.SsqDrawingFromLecaiUtil;

public class LoadNextFromLecaiService {

	public static void main(String[] args) {

	}
	
	public static boolean loadNext(){
		boolean flag = false;
		int nextTerm = NextTermUtil.next();
		int nextNext = NextTermUtil.nextNext();
		try {
			String content = SsqDrawingFromLecaiUtil.getDataFromHtml(nextTerm);
			flag = SsqDrawingFromLecaiUtil.writeBallsAndReward(content, nextTerm);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		//获取开奖信息成功，则进行上一期次的开奖数据分析
		//并且预测下一次期的开奖号码
		if(flag){
			LoadNextService.analysisAll(nextTerm);
			LoadNextService.forecastAll(nextNext);
		}
		return flag;
	}

}
